def register(funcMap, funcName):
    def decorator(f):
        funcMap[funcName] = f
        return f
    return decorator

map = {}

class mycla:
    def __init__(self):
        self.map = {}

    @register(map, 'add')
    def add(self, a, b):
        return a + b


def add(a, b):
    return a+b

def sub(a, b):
    return a - b


res = (add if False else sub)(1, 2)
print(res)